﻿<%@  Language="C#" MasterPageFile="Admin.master" %>
<%@ Register src="../module/Types.ascx" tagname="Types" tagprefix="inal" %>
<script runat="server">
    private int Item_Id = 0;
    private Text MyText;
    protected void Page_Load(object sender, EventArgs e)
    {
        Item_Id = Utils.GetQueryString("id", 0);
        MyText = new Text(Item_Id,"",false);
    }
    public string FormatHtmlCode(string Text_Value)
    {
        /* 多余的空格处理 */
        //Text_Value = Text_Value.Replace("&amp; nbsp;", " ");
        //Text_Value = Text_Value.Replace("&nbsp;", "");
        //Text_Value = Text_Value.Replace("  ", "");
        ///* 双引号处理 */
        //Text_Value = Text_Value.Replace("&quot;", "\"");
        ///* 空格处理 */
        //Text_Value = Text_Value.Replace("&nbsp;", " ");
        Text_Value = Text_Value.Replace("&amp;lt;", "<");
        Text_Value = Text_Value.Replace("&amp;gt;", ">");

        Text_Value = Text_Value.Replace("&lt;", "<");
        Text_Value = Text_Value.Replace("&gt;", ">");

        ///* URL 选晰 */
        Text_Value = Utils.HtmlDecode(Text_Value);
        //Text_Value = Text_Value.Replace("&amp;amp;", "&");
        return Text_Value;
    }
    
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><%=Lang.Show("NewsCenter") %> - <%if (Item_Id == 0) { %> <%=Lang.Show("Add") %><%} else { %><%=Lang.Show("Edit") %><%} %></asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
	<link href="../Pulgin/kindeditor-4.1/themes/default/default.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../static/js/Verification.js"></script>
	<script type="text/javascript" src="../Pulgin/kindeditor-4.1/kindeditor-all.js" ></script>
	<script src="../Pulgin/kindeditor-4.1/lang/zh_CN.js" type="text/javascript"></script>
	<script type="text/javascript">
        /* 输入法激活 */
	    bedit_allow = "Item_Title:Item_Summary";
        $(document).ready(function(){
            $("#Typ1_0").val(<%=MyText.Item_Column %>)
        });
        var Item_Time='<%= MyText.Item_Time%>';
        /* 编辑激活 */
        var editor;
        KindEditor.ready(function(K) {
	        editor = K.create('textarea[name="content"]', {allowFileManager : true,pasteType : 1});
        });
    </script>

	<table >
		<tr>
			<td class="text"><%=Lang.Show("Columns") %> : </td>
			<td><inal:Types runat="server" Type="1"  /></td>
			<td><div id="Validate-Typ1_0"></div></td>
		</tr>
		<tr>
			<td class="text"><%=Lang.Show("Title") %> (<code title='<%=Lang.Show("MaxLength")%>' id="Item_Title_Code"><%=320-MyText.Item_Title.Length %></code>) :</td>
			<td><input value="<%=MyText.Item_Title %>" type="text" id="Item_Title" name="Item_Title" class="longtext" maxlength="320" /></td>
			<td><div id="Validate-Item_Title"></div></td>
		</tr>
		<tr>
			<td class="text"><%=Lang.Show("Summary")%> :<br />(<code title='<%=Lang.Show("MaxLength")%>' id="Item_Summary_Code"><%=420-MyText.Item_Summary.Length %></code>)</td>
			<td><textarea id="Item_Summary" name="Item_Summary" rows="3" class="longtext"><%=MyText.Item_Summary%></textarea></td>
			<td><div class="warnig" id="Item_Summary_Error"></div></td>
		</tr>
	</table>

		<div class="ch10"></div>
		<textarea id="KindEditor" name="content" style="width:940px; height:400px;" ><%=FormatHtmlCode(MyText.Item_Story)%></textarea>
		<div class="ch10"></div>
		<div>
			<table class="inputs">
                <tr>
                    <td class="text"><%=Lang.Show("Url")%> :</td>
                    <td><input type="text" id="Item_Url"  class="cn" value="<%=Utils.UrlDecode(MyText.Item_Url) %>" /></td>
                    <td></td>
                </tr>
				<tr>
					<td class="text"><%=Lang.Show("Published")%> :</td>
					<td><input type="datetime"  id="Item_Time"  class="cn" value="<%=MyText.Item_Time.ToString("yyyy/MM/dd HH:mm:ss") %>" /></td>
					<td></td>
				</tr>
				<tr>
					<td class="text"><%=Lang.Show("Order")%> :</td>
					<td><input type="text" id="Orders" maxlength="3" class="cn" value="<%=MyText.Orders %>" /></td>
					<td><div id="Validate-Orders"></div></td>
				</tr>
			</table>
		</div>

        <div id="Propertys">
            <button><%=Lang.Show("PropertyRemark")%></button>
            <div id="Propertys_Area">
			<table class="inputs">
                <tr>
					<td class="text"><%=Lang.Show("ExpiredTime") %>:</td>
					<td><input type="datetime"  id="Maturity_Time"  class="cn time" value="<%=MyText.Maturity_Time.ToString("yyyy/MM/dd HH:mm:ss") %>" /></td>
					<td></td>
				</tr>
                <tr>
                    <td class="text"><%=Lang.Show("Property")%> 1 :</td>
                    <td><input type="text" id="Property1" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property1 %>" /></td>
                    <td></td>
                </tr>
				<tr>
					<td class="text"><%=Lang.Show("Property")%> 2 :</td>
                    <td><input type="text" id="Property2" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property2 %>" /></td>
                    <td></td>
				</tr>
				<tr>
					<td class="text"><%=Lang.Show("Property")%> 3 :</td>
                    <td><textarea  placeholder="<%=Lang.Show("PropertyRemark")%>" id="Property3" rows="3"><%=MyText.Property3 %></textarea></td>
                    <td></td>
				</tr>
                <tr>
					<td class="text"><%=Lang.Show("Property")%> 4 :</td>
                    <td><input type="text" id="Property4" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property4 %>" /></td>
                    <td></td>
				</tr>
                <tr>
					<td class="text"><%=Lang.Show("Property")%> 5 :</td>
                    <td><input type="text" id="Property5" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property5 %>" /></td>
                    <td></td>
				</tr>
                <tr>
					<td class="text"><%=Lang.Show("Property")%> 6 :</td>
                    <td><input type="text" id="Property6" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property6 %>" /></td>
                    <td></td>
				</tr>
                <tr>
					<td class="text"><%=Lang.Show("Property")%> 7 :</td>
                    <td><input type="text" id="Property7" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property7 %>" /></td>
                    <td></td>
				</tr>
                <tr>
					<td class="text"><%=Lang.Show("Property")%> 8 :</td>
                    <td><input type="text" id="Property8" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property8 %>" /></td>
                    <td></td>
				</tr>
                <tr>
					<td class="text"><%=Lang.Show("Property")%> 9 :</td>
                    <td><input type="text" id="Property9" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property9 %>" /></td>
                    <td></td>
				</tr>
                <tr>
					<td class="text"><%=Lang.Show("Property")%> 10 :</td>
                    <td><input type="text" id="Property10" placeholder="<%=Lang.Show("PropertyRemark")%>" value="<%=MyText.Property10 %>" /></td>
                    <td></td>
				</tr>
			</table>
		</div>
        </div>

		<button onclick="News_AddEdit(<%=Item_Id %>)" class="button"><%=Lang.Show("Submit")%></button>

	<script type="text/javascript">
    ShowLimitLength(320, "Item_Title");
    ShowLimitLength(420, "Item_Summary");
    /* 扩展区控制函数 */
    ShowHidePropertys()

</script>
</asp:Content>
